/**
 * 拉框查询控件
 * @class OpenLayers.Control.PolygonQuery
 * 继承自: - <OpenLayers.Control>
 * @requires extend/Control/PointQuery.js
 */
OpenLayers.Control.PolygonQuery = OpenLayers.Class(OpenLayers.Control.PointQuery,{

	/**
	 * 工具按钮提示文字
	 * @property title
	 * @type {String}
	 */
	title : "框查",
	
	/**
	 * 控件被触发时设置鼠标手势
	 * @method activate
	 */
	activate : function() {
		OpenLayers.Control.prototype.activate.apply(this,arguments);
		this.map.layerContainerDiv.style.cursor = "url("
				+ AT21.WebGIS.getAT21RootLocation()
				+ "img/PolygonQuery.cur),default";
	},

	/**
	 * @method draw
	 */
	draw : function() {
		this.handler = new OpenLayers.Handler.Polygon(this, {
			done : this.executeQuery
		});
	},

	/**
	 * evt转为空间对象geometry 
	 */
	evtToCoord : function(evt) {
		if (evt instanceof OpenLayers.Geometry.Polygon) {
            var polygon = evt+"";
            return polygon;
        } else { // it's a pixel
            alert("请做多边形查询！");
            return null;
        }
	},

	CLASS_NAME : "OpenLayers.Control.PolygonQuery"
});